package com.yenlien.traceyun.business.entity;

import com.yenlien.traceyun.business.service.RecallData;
import com.yenlien.traceyun.business.trace.Trace;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 分包
 *
 * @author maybe
 * @date 2020年7月30日
 */
@Entity
@Table(name = "t_subpackage")
@Trace(appName = "plant", stepName = "subpackage", order = 20, ended = true)
public class Subpackage extends TraceScanEntity implements RecallData {
    @Column
    private String relevanceId;        //关联ID
    @Column
    private String source;            //分包来源
    @Column
    private String spec;            //规格
    @Column
    private String specUnits;        //单位
    @Column
    private int subNumber;            //分包数，			追溯码数量
    @Column
    private int branchPackageNum;        //实际分包数
    @Column
    private int isOk;                //是否容错(0否，1是)
    @Column
    private String weight;            //重量
    @Column
    private String units;            //单位
    @Column
    private int totalNumber;        //总数量
    @Column
    private int printNumber;        //打印数量
    @Column
    private String productName;        //产品名称
    @Column
    private String types;        //分包类型：0:pc分包		1：微信分包

    /**
     * 是否已经生成了码
     */
    @Column(name = "gen_coded")
    private boolean genCoded;

    /**
     * 分包批次
     */
    @Column(name = "batch", length = 30, unique = true)
    private String batch;

    @Column
    private String grade;            //品级、供应商

    /**
     * 应用id
     */
    @Column(name = "app_id", length = 32)
    private String appId;

    @Transient
    private int activationSum;        //未打码数量

    @Transient
    private String img;        //产品图片

    @Transient
    private String type;    // 区分是种植还是生产系统  为空就是生产，不为空就是种植


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRelevanceId() {
        return relevanceId;
    }

    public void setRelevanceId(String relevanceId) {
        this.relevanceId = relevanceId;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getSpecUnits() {
        return specUnits;
    }

    public void setSpecUnits(String specUnits) {
        this.specUnits = specUnits;
    }

    public int getSubNumber() {
        return subNumber;
    }

    public int getIsOk() {
        return isOk;
    }

    public void setIsOk(int isOk) {
        this.isOk = isOk;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getUnits() {
        return units;
    }

    public void setUnits(String units) {
        this.units = units;
    }

    public int getTotalNumber() {
        return totalNumber;
    }

    public void setTotalNumber(int totalNumber) {
        this.totalNumber = totalNumber;
    }

    public int getPrintNumber() {
        return printNumber;
    }

    public void setPrintNumber(int printNumber) {
        this.printNumber = printNumber;
    }

    public void setSubNumber(int subNumber) {
        this.subNumber = subNumber;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getBatch() {
        return batch;
    }

    public void setBatch(String batch) {
        this.batch = batch;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    @Override
    public String getRecallName() {
        return this.productName;
    }

    @Override
    public String getRecallSpec() {
        return spec + specUnits;
    }

    @Override
    public String getRecallNum() {
        return this.totalNumber + "";
    }

    public boolean isGenCoded() {
        return genCoded;
    }

    public void setGenCoded(boolean genCoded) {
        this.genCoded = genCoded;
    }

    public int getActivationSum() {
        return activationSum;
    }

    public void setActivationSum(int activationSum) {
        this.activationSum = activationSum;
    }

    public int getBranchPackageNum() {
        return branchPackageNum;
    }

    public void setBranchPackageNum(int branchPackageNum) {
        this.branchPackageNum = branchPackageNum;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getTypes() {
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }
}
